import React, { memo, useContext, } from 'react'
import { userContext, themeContext } from './context'
const App = memo(() => {
  const user = useContext(userContext)
  const theme = useContext(themeContext)
  // useContext 接收一个context对象（React.createContext的返回值）并返回该context的当前值。
  return (
    <div>
      <h3 style={theme}>{user.name}</h3>
    </div>
  )
})

export default App